package 正则表达式;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author chihb
 * @create-time 2024/7/1 16:47
 * @description
 */
public class RegExp1 {
    public static void main(String[] args) {
        //验证汉字
        //String content1="韩三平额外成交额";
        //String regex1="^[\u0391-\uffe5]+$";
        //邮政编码
        //String content2="123890";
        //String regex="^[1-9]\\d{5}$";
        //QQ号
        String regStr="^[1-9]\\d{4,9}$";
        String content2="1234568";
        Pattern pattern=Pattern.compile(regStr);
        Matcher matcher=pattern.matcher(content2);
        if (matcher.find()){
            System.out.println("满足格式");
        }else {
            System.out.println("不满足格式");
        }
//        while (matcher.find()){
//            System.out.println(matcher.group(0));
//        }
    }
}
